<template>
	<div class="main">
		<div class="form-container">
			<div  class="form-main">
				<span class="one_title">&nbsp;&nbsp;一、基本情况&nbsp;&nbsp;</span>
				<div class="name">
					
					<label for="name" class="littleTile">1. 姓名</label><span class="required" style="color:red">*</span><br/>
					<input class="form-border" id="name" type="text" name="username" maxlength="20" placeholder="姓名" required="required" v-model="name"  @blur='checkName' /> <br/>
				</div>
				<div class="sex">
					
					<label for="gender" class="littleTile" required>2.性别</label><span class="required" style="color:red">*</span><br/>
					<div class="form-border form-twoBor"  style="border: 1px solid #c6c8c9;">
						<div>
                <el-radio v-model="sex" label="0">男</el-radio>
            </div>
            <div style="border-top: 1px solid #c6c8c9;" >
              <el-radio v-model="sex" label="1">女</el-radio>
            </div>
					</div>
				</div>
				<div class="idNumber">
					<!-- <span class="required" style="color:red">*</span> -->
					<label for="idNumber" class="littleTile">3. 身份证号/护照号/其他ID号</label><br/>
					<input class="form-border" id="idNumber" type="text" name="idNumber" @blur="checkIDNumber" maxlength="20" placeholder="请填写身份证号/护照号/其他ID号"  v-model="idNumber"  /> <br/>
				</div>
				<div class="native-place">
					<!-- <span class="required" style="color:red">*</span> -->
					<label for="gender" class="littleTile" required>4. 籍贯</label><span class="required" style="color:red">*</span><br/>
					<input class="form-border" type="text" readonly @click="openCityShow('nativePlace')"  placeholder="籍贯" required="required" v-model="nativePlaceName"  />
					<!-- <div class="form-border form-twoBor"  style="border: 1px solid #c6c8c9;">
						<div>
							<el-radio v-model="nativePlace" label="0">本地</el-radio>
						</div>
						<div style="border-top: 1px solid #c6c8c9;" >
						<el-radio v-model="nativePlace" label="1">外地</el-radio>
						</div>
					</div> -->
				</div>
				<div class="phoneNum">
					
					<label for="phone" class="littleTile">5. 联系电话(手机)</label><span class="required" style="color:red">*</span><br/>
					<input class="form-border" id="phone" type="text" name="phoneNum" maxlength="11" placeholder="请填写联系电话" v-model="phone" @blur="checkPhone" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" /><br/>
				</div>
				<div class="enterpriseName" style="position: relative;">
					<!-- <span class="required" style="color:red">*</span> -->
					<label for="enterpriseName" class="littleTile">6. 所属单位</label><span class="required" style="color:red">*</span><br/>
					<input @keyup="search($event)" class="form-border" id="enterpriseName" type="text" name="enterpriseName" maxlength="20" placeholder="所属单位" required="required" v-model="enterpriseName"  /> <br/>
					<ul>
						<li v-for ="(item,index) in matchpriseList" @click="fillBack(item)" :key="index">{{item.name}}</li>
					</ul>
					<!-- <div style="position: absolute;right: 10px;top: 36px;" @click="showPopupPicker=true" >···</div>
              		<popup-picker :showCell="false"  :show.sync="showPopupPicker" ref="enterprises" :data="enterpriseList"   :columns="3" v-model="enterpriseModel" ></popup-picker>
					-->
				</div>
				<div class="deptment">
					<!-- <span class="required" style="color:red">*</span> -->
					<label for="deptment" class="littleTile">7. 所在一级部门</label><br/>
					<input class="form-border" id="deptment" type="text" name="deptment" maxlength="20" placeholder="所在一级部门" required="required" v-model="deptmentName"  /> <br/>
				</div>
				<div class="employeeCode">
					<!-- <span class="required" style="color:red">*</span> -->
					<label for="employeeCode" class="littleTile">8. 人员编号</label><br/>
					<input class="form-border" id="employeeCode" type="text" name="employeeCode" maxlength="20" placeholder="人员编号" required="required" v-model="employeeCode" @blur="verifyBar($event)" /> <br/>
				</div>
				 
				<label for="job" required class="littleTile">9. 工作岗位</label><span class="required" style="color:red">*</span><br/>
				<div class="form-border form-twoBor" style='border: 1px solid #c6c8c9;'>
					<div >
						<el-radio v-model="job" label="0">正式合同制</el-radio>
					</div>
					<div style="border-top: 1px solid #c6c8c9; " >
						<el-radio v-model="job" label="1">临时聘用</el-radio>
					</div>
				</div>
				
				
				
				
			</div>

		</div>
		<!-- <datetime style="display:none;" v-model="queryTime" @on-change="changeTime" :show.sync="timeShow"></datetime> -->
		<!-- <confirm v-model="showconfirm"
			:title="confirmtitle"
			@on-cancel="onCancel"
			@on-confirm="onConfirm"
			@on-show="onShow"
			@on-hide="onHide">
		</confirm> -->
		<div v-transfer-dom>
			<popup v-model="showSelectPopup" @on-hide="changeState('hide')" @on-show="changeState('show')"  height="50%">
				<menuLinkage :queryObj="casList" @setCityObj="setCityObj" ref="menuLinkage" />
			</popup>
		</div>

		<div v-transfer-dom>
			<popup v-model="showSelectCityPopup" @on-hide="changeState('hide')" @on-show="changeState('show')" height="50%">
				<menuLinkage :queryObj="casListCity" @setCityObj="setCityObjTwo" ref="menuLinkageTwo" />
			</popup>
		</div>
		<div v-transfer-dom>
			<popup v-model="showSelectToCityPopup" @on-hide="changeState('hide')" @on-show="changeState('show')" height="50%">
				<menuLinkage :queryObj="casListCity" @setCityObj="setToCityObjTwo" ref="menuLinkageOne" />
			</popup>
		</div>

	</div>
</template>
<script>
import { requestEnterpriseData ,queryCityData,queryCityDataForTwo,queryEnterpriseList} from '@/assets/js/service'
import fromConfig from '../../../static/formConfig'
import { Confirm , Datetime,PopupPicker,Popup,TransferDom} from 'vux'
import menuLinkage from '../commons/menuLinkage.vue'
import { forbiddenBar } from '@/assets/js/common'

export default {
	directives: {
		TransferDom
	},
    components: {
        Confirm,
        Datetime,
        PopupPicker,
        Popup,
        menuLinkage
    },
    data () {
        return {
					nativePlace:'',
					nativePlaceName:"",
						casList:[],
						casModel:[],
						casListCity:[],
						showPopupPicker:false,
						enterpriseList:[],
						matchpriseList:[],
						enterpriseModel:[],
						showSelectPopup:false,//是否显示级联组件
						showSelectCityPopup:false,//显示城市组件
						showSelectToCityPopup:false,//显示去的城市组件
						flagCity:"",//标识当前选中城市赋值
						backDateshow:false,
						leaveDateShow:false,
						postDateShow:false,
						planBackDateShow:false,
						relieveDateShow:false,
						beenHubeiDateShow:false,
						leaveHubeiDateShow:false,
						showPostDate:true,
						endDate:"",//限定最大日期
						leaveHabitationShow:false,
						remnant:0,
						// 表单字段
						name:'',//姓名
						enterpriseName:'',//所属单位
						enterpriseCode:'',//单位编码
						employeeCode:'',//人员编号
						idNumber:'',//身份证号
						sex:'0',//性别
						deptmentName:'',//所在一级部门
						job:'0',//工作岗位
						phone:'',//联系电话

						address:'',//固定居住地址（城市、区县、街道、社区、小区、楼栋、单元、楼层、房间号）
						residence:'',//
						community:'',//您所在的小区
						communityCode:'',//小区编码
						building:'',//楼号
						unit:'',//单元
						roomNumber:'',//房间号

						currentProvince:'',//当前所在省
						currentCity:'',//市（当前所在地）
						currentCounty:'',//区/县
						currentCountry:'',//街道/乡/镇
						currentVillage:'',//社区/村
			 //新增
            currentProvinceCode:'',//当前所在省 code
            currentCityCode:'',//当前所在市 code
            currentCountyCode:'',//当前所在区/县 code
            currentCountryCode:'',//街道/乡/镇（当前所在地）code
            currentVillageCode:'',////社区/村（当前所在地）code
            communityCode:'',//小区code

						dutyStatus:'1',//在岗状态(1远程在岗、2现场在岗，3离岗，4出差，5休假）
						tdutyStatus:'1',
						ydutyStatus:'1',
						postDate:'',//预计返岗日

            countdown:"5",//倒计时
            countdownFlag:true,
            info:{
							commuityCode:'',//小区编码
							commuityName:'',//小区名称
							regionalismCode:'',//行政区划code
							responsible:'',//责任人
							responsiblePhone:'',//责任人电话
            }
        }
    },
    created () {
		// commuityCode=小区编码&commuityName=小区名称&regionalismCode=行政区划code &responsible=责任人&responsiblePhone=责任人电话
		this.info=this.$route.query;
		console.log(this.info)
		this.community=this.info.commuityName;//小区名称
		this.communityCode=this.info.commuityCode;//小区编码
		// this.regionalismCode=this.info.regionalismCode;//行政区划code
		// this.responsible=this.info.responsible;//责任人
		// this.responsiblePhone=this.info.responsiblePhone;//责任人电话
		this.endDate=this.$formatTimeStr(new Date(),1);
		this.initcascade();
		let arr = JSON.parse(localStorage.getItem('enterpriseHomeData'))
			if(arr) {
				let personInfo = JSON.parse(arr[0])
				this.name = personInfo.name;
				this.sex = personInfo.sex;
				this.idNumber = personInfo.idNumber;
				this.phone = personInfo.phone;
				this.enterpriseCode = personInfo.enterpriseCode;
				this.enterpriseName = personInfo.enterpriseName;
				this.deptmentName = personInfo.deptmentName;
				this.job = personInfo.job;
				this.employeeCode = personInfo.employeeCode;
				this.nativePlace = personInfo.nativePlace;
				this.nativePlaceName=personInfo.nativePlaceName;
			}
    },
    mounted: function () {
		queryEnterpriseList({areaName: "",currentPage: null,name: "",pageSize: 0},(res)=>{
			console.log("queryEnterpriseList==>",res)
			//enterpriseList
			this.enterpriseList=[];
			if(res.data&&res.data.length>0){
			res.data.forEach((item,index)=>{
				let obj={name:item.name,value:item.id, parent: 0}
				this.enterpriseList.push(obj);
			})
			}
		})
		
		},    watch:{
		remark(){
			this.remnant=this.remark.length;
		},
		phone(){
        let reg = /^[1][3,4,5,7,8][0-9]{9}$/;
        if(!reg.test(this.phone)) {
          this.phone = this.phone.replace(/\D/g, '');
        }
      },
      name() {
        //     let nameReg = /^ [\u4e00 - \u9fa5] | [a-zA-Z]$/  ;
        //     console.log(nameReg.test(this.nameModel)) ;
        // 　　if(!nameReg.test(this.nameModel)){
        // 　　　　window.vm.$vux.toast.text('姓名填写有误', 'center')
        // 　　　　return false;
        //     }　　　
        var regu = "^[a-zA-Z\u4e00-\u9fa5]+$";
        var re = new RegExp(regu);
        if(this.name == '') {
          return true;
        } else {
          if (this.name.search(re) != -1) {
            return true;
          } else {
            this.name = this.name.slice(0, this.name.length-1)
            return false;
          }
        }
	  },
	   idNumber() {
        // let pattern = /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/
        // let date = new Date()
        // if(this.idNumber.length > 17){
        //   if(!pattern.test(this.idNumber)) {
        //     window.vm.$vux.toast.text('证件号填写有误', 'center')
        //   } else {
        //     let ageMuis = date.getFullYear() - this.idNumber.substring(6,10);
        //      if(ageMuis > 0){
        //        this.ageModel = ageMuis;
        //      } else {
        //        // window.vm.$vux.toast.text('证件号填写有误', 'center')
        //      }
        //      var num = this.idNumber.charAt(16);
        //      // let num = this.idNumber.substring(16,18);
        //      console.log(num);
        //      if(num%2==0){
        //        // console.log('女');
        //        this.genderModel = 1
        //        this.isChecked = true;
        //      }else{
        //        this.genderModel = 0
        //        this.isChecked = true;
        //      }
        //   }
        //
        // }
        if(this.idNumber == '') {
          return true;
        } else {
          let pattern = /^[\dA-Za-z][\dA-Za-z]{5,17}$/;
          if (!pattern.test(this.idNumber)) {
            this.idNumber = this.idNumber.replace(/[^\dA-Za-z]+/g, '');
          }
          this.$forceUpdate();
        } 
      },
		enterpriseModel(){
			if(this.enterpriseModel&&this.enterpriseModel.length>0){
			   this.enterpriseName=this.$refs.enterprises.getNameValues()
			   this.enterpriseCode=this.enterpriseModel[0];
			}
		},
		enterpriseName(){
			
		},
		// symptom(){
		// 	console.log(this.symptom)
		// 	if(this.symptom.length>1&&this.symptom.indexOf("无")>=0){
		// 		this.symptom=[];
		// 		this.symptom.push("无");
		// 	}
		// },
		leaveHabitation(){
			if(this.leaveHabitation=='1'){
				this.leaveHabitationShow=true;
			}else{
				this.leaveHabitationShow=false;
			}
		},
		dutyStatus(){
			if(this.dutyStatus&&parseInt(this.dutyStatus)>2){
				this.showPostDate=true;
			}else{
				this.showPostDate=false;
				this.postDate='';
			}
		},
		beenHubeiDate(){
			if(this.beenHubeiDate&&this.leaveHubeiDate&&this.beenHubeiDate>this.leaveHubeiDate){
				window.vm.$vux.toast.text('离开湖北时间不能早于去湖北时间', 'center')
				this.beenHubeiDate="";
			}
		},
		leaveHubeiDate(){
			if(this.beenHubeiDate&&this.leaveHubeiDate&&this.beenHubeiDate>this.leaveHubeiDate){
				window.vm.$vux.toast.text('离开湖北时间不能早于去湖北时间', 'center')
				this.leaveHubeiDate="";
			}
		},
		name(){
			this.name=this.$changeVal(this.name);
			let namelength= this.name.length;
			if(namelength>20){
				window.vm.$vux.toast.text('姓名长度不能大于20', 'center')
				this.name=this.name.substr(0,20)
			} else {
				var regu = "^[a-zA-Z\u4e00-\u9fa5]+$";
        var re = new RegExp(regu);
        if(this.name == '') {
          return true;
        } else {
          if (this.name.search(re) != -1) {
            return true;
          } else {
            window.vm.$vux.toast.text('姓名填写有误，请输入中文或者英文', 'center')
            return false;
          }
        }
			}
			// var regu = "^[a-zA-Z\u4e00-\u9fa5]+$";
			// var re = new RegExp(regu);
			// if (this.nameModel.search(re) != -1){
			// 	return true;
			// } else {
			// 	window.vm.$vux.toast.text('姓名填写有误', 'center')
			// 	return false;
			// }
        },
        // idNumber(){
		// 	let pattern = /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/
		// 	let date = new Date()
		// 	if(this.idNumber.length > 17){
		// 		if(!pattern.test(this.idNumber)) {
		// 			window.vm.$vux.toast.text('证件号填写有误', 'center')
		// 		} else {
		// 			var num = this.idNumber.charAt(16);
		// 			console.log("fff=>"+num);
		// 			if(num%2==0){
		// 				// console.log('女');
		// 				this.sex = 1
		// 				this.isChecked = true;
		// 			}else{
		// 				this.sex = 0
		// 				this.isChecked = true;
		// 			}
		// 		}

		// 	}
        // },
    },
    methods: {
		changeState(statusFlag){
			console.log(statusFlag)
		},
		beenHubeiFlag(){
			if(this.beenHubei==1){
				this.leaveHubeiDate='';
				this.beenHubeiDate='';
				console.log('1'+this.leaveHubeiDate)
			}
			console.log('2'+this.leaveHubeiDate)


		},
        submitClick(){
            let _this = this;
			let param={
				name:this.name,//姓名
				enterpriseName:this.enterpriseName,//所属单位（企事业单位、高校、科研院所等名称）
				enterpriseCode:this.enterpriseCode,//单位编码
				employeeCode:this.employeeCode,//人员编号
				idNumber:this.idNumber,
				sex:this.sex,
				deptmentName:this.deptmentName,//所在一级部门（院系、所室等）
				job:this.job,//工作岗位（正式合同制、临时聘用）
				phone:this.phone,//联系电话-必填
				address:this.residence+"/"+this.community+"/"+this.unit+"/"+this.roomNumber,//
				dutyStatus:this.dutyStatus,//在岗状态（1远程在岗、2现场在岗，3离岗，4出差，5休假）
				postDate:this.postDate,//预计返岗日期
				leaveDate:this.leaveDate,//离开固定驻地时间
				leaveHabitation:this.leaveHabitation,//近期是否离开固定驻地
				toCity:this.toCity,//所赴城市
				back:this.back,//是否已返回
				currentCityName:this.currentCity,//目前所在城市,
				backDate:this.backDate,//返回时间
				vehicle:this.vehicle,//离开与返回的交通工具
				beenHubei:this.beenHubei,//1月1日以后是否去过湖北,
				passHubei:this.passHubei,//是否经停湖北
				planBackDate:this.planBackDate,//计划返回时间
				touchHubei:this.touchHubei,//离开期间是否与湖北地区的人员接触
				fourteenDayTouchWuhan:this.fourteenDayTouchWuhan,//14日内是否接触过武汉来人（1是,0否）
				fourteenDayTouchHubei:this.fourteenDayTouchHubei,//14日内是否接触过湖北来人（1是,0否）
				fever:this.fever,//是否发热（>=37.3度）（1是,0否）
				symptom:this.symptom.join(","),//其它症状
				backTogether:this.backTogether.join(","),//一起返回的家属
				familySymptom:this.familySymptom,//家属身体状况（0正常，1异常）
				reportCommittee:this.reportCommittee,//是否向所在社区居委会登记报到（1是,0否）
				fourteenDayIsolation:this.fourteenDayIsolation,//外地返回是否做自我居家隔离14天
				remark:this.remark,//其他需要报告的情况,
				currentProvince:this.currentProvinceCode,//
				currentCity:this.currentCityCode,
				currentCounty:this.currentCountyCode,
				currentCountry:this.currentCountryCode,
				currentVillage:this.currentVillageCode,
				commuityCode:this.communityCode,
				community:this.community,//小区（详细地址）
				building:this.building,//楼栋
				unit:this.unit,//单元
				roomNumber:this.roomNumber,
				personnelType:this.personnelType,
				relieveDate:this.relieveDate,
				trainNumber:this.trainNumber,
				beenHubeiDate:this.beenHubeiDate,
				leaveHubeiDate:this.leaveHubeiDate,
				peopleHubei:this.peopleWuhan,
				peopleWuhan:this.peopleWuhan,
			}


			if(_this.$verification(this.name,0,"姓名")&&_this.$verification(this.phone,0,"联系电话")&&_this.$verification(this.phone,1,"联系电话")&&_this.$verification(this.sex,0,"性别")&&_this.$verification(this.deptmentName,0,"所在一级部门")
			&&_this.$verification(this.job,0,"工作岗位")&&_this.$verification(this.currentProvinceCode,0,"固定居住地址")&&_this.$verification(this.community,0,"小区")&&_this.$verification(this.building,0,"楼号")
			&&_this.$verification(this.unit,0,"单元")&&_this.$verification(this.unit,2,"单元")&&_this.$verification(this.roomNumber,0,"房间号")
			&&_this.$verification(this.roomNumber,2,"房间号")&&_this.$verification(this.dutyStatus,0,"在岗状态")
			&&_this.$verification(this.currentCityName,0,"目前所在城市")){
				var regu = "^[a-zA-Z\u4e00-\u9fa5]+$";
				var re = new RegExp(regu);
				if (_this.name.search(re) != -1){

				} else {
					window.vm.$vux.toast.text('姓名填写有误', 'center')
					return false;
				}
				let flagBoolean=false;
				 if(_this.leaveHabitationShow){
				 	 if(_this.$verification(this.toCity,0,"所赴城市")){
						  flagBoolean=true;
					  }
				 }else{
					 flagBoolean=true;
				 }
				if(flagBoolean){
					requestEnterpriseData(param,(res)=>{
						console.log("return==>",res);
						if(res.success){
							_this.countdownFlag=false;
							var timeId =setInterval(() => {
								_this.countdown--
								console.log('1')
								if(_this.countdown==0){
									_this.countdownFlag=true;
									_this.countdown=5;
									clearInterval(timeId)
								}
							},1000)
							_this.$showBottomToast("上报成功")
						}else{
							_this.$showBottomToast("上报失败")
						}
					})
				}

			}
		},
		changeTime(){

		},
		checkName() {
			this.$emit('testName', this.name)
		},
		openCityShow(flag){
			this.flagCity=flag;
			this.showSelectCityPopup=true;

		},
		openToCityShow() {
			this.showSelectToCityPopup=true;
		},
        initcascade(){
			let _this=this;
            queryCityData({"parentCode":"000000"},function(res){
                // console.log("resaaaaaaaaaaaaaaaaaaaa==>",res)
                _this.casList=[];
                if(typeof(res.data)!="undefined"&&res.data.length>0){
                    _this.casList=res.data;
										_this.$refs.menuLinkage.initData(_this.casList,1);
										// 去掉默认的北京市固定地址
                    // _this.$refs.menuLinkage.setDefault(['北京市'])
                }
			})
			//初始化行政区划二级
            queryCityDataForTwo({},function(res){
                console.log("res  queryCityDataForTwo==>",res)
                _this.casListCity=[];
                if(typeof(res.data)!="undefined"&&res.data.length>0){
                    _this.casListCity=res.data;
										_this.$refs.menuLinkageTwo.initData(_this.casListCity,0);
										_this.$refs.menuLinkageOne.initData(_this.casListCity,0);
                }
            })
		},
		setCityObj(_list){
            if(typeof(_list[0])!='undefined'){
                this.currentProvince=_list[0].name;
				this.currentProvinceCode=_list[0].code;
				this.residence=_list[0].name;
            }
            if(typeof(_list[1])!='undefined'){
                this.currentCity=_list[1].name;
				this.currentCityCode=_list[1].code;
				this.residence=this.residence+"/"+_list[1].name;
            }
            if(typeof(_list[2])!='undefined'){
                this.currentCounty=_list[2].name;
				this.currentCountyCode=_list[2].code;
				this.residence=this.residence+"/"+_list[2].name;
            }
            if(typeof(_list[3])!='undefined'){
                this.currentCountry=_list[3].name;
				this.currentCountryCode=_list[3].code;
				this.residence=this.residence+"/"+_list[3].name;
            }else{
                this.currentCountry="";
            }
            if(typeof(_list[4]) !='undefined'){
              this.currentVillage = _list[4].name;
			  this.currentVillageCode = _list[4].code;
			  this.residence=this.residence+"/"+_list[4].name;
            } else {
              this.currentVillage = '';
            }
            this.showSelectPopup=false;
		},
		setToCityObjTwo(_list){
			 if(typeof(_list[0])!='undefined'){
					this.toCity=_list[0].name;
				}
				if(typeof(_list[1])!='undefined'){
					this.toCity=this.toCity+"/"+_list[1].name;
				}
				this.showSelectToCityPopup=false;
		},
		setCityObjTwo(_list){
			if(this.flagCity=="toCity"){
				 if(typeof(_list[0])!='undefined'){
					this.toCity=_list[0].name;
				}
				if(typeof(_list[1])!='undefined'){
					this.toCity=this.toCity+"/"+_list[1].name;
				}
			}else if(this.flagCity=="currentCityName"){
				 if(typeof(_list[0])!='undefined'){
					this.currentCityName=_list[0].name;
				}
				if(typeof(_list[1])!='undefined'){
					this.currentCityName=this.currentCityName+"/"+_list[1].name;
				}
			}else if(this.flagCity=="nativePlace"){
				 if(typeof(_list[0])!='undefined'){
					this.nativePlaceName=_list[0].name;
					this.nativePlace=_list[0].code;
				}
				if(typeof(_list[1])!='undefined'){
					this.nativePlaceName=this.nativePlaceName+"/"+_list[1].name;
					this.nativePlace=this.nativePlace+","+_list[1].code;
				}
			}
			this.showSelectCityPopup=false;

		},
		checkIDNumber(){
          // let pattern = /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/;
        //   let pattern =  /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;;
        //   let date = new Date();
        //     if(!pattern.test(this.idNumber)) {
        //       window.vm.$vux.toast.text('证件号填写有误', 'center')
        //     } else{
        //         // let ageMuis = date.getFullYear() - this.idNumber.substring(6,10);
        //         // if(ageMuis > 0){
        //         //   this.ageModel = ageMuis;
        //         // } else {
        //         //   // window.vm.$vux.toast.text('证件号填写有误', 'center')
        //         // }
        //         // var num = this.idNumber.charAt(16);
        //         // // let num = this.idNumber.substring(16,18);
        //         // console.log(num);
        //         // if(num%2==0){
        //         //   // console.log('女');
        //         //   this.six = 1;
        //         //   this.isChecked = true;
        //         // }else{
        //         //   this.genderModel = 0
        //         //   this.isChecked = true;
        //         // }
        //     }
        },
		verifyBar(e) {
			console.log('wanchegnle 输入')
			let reg = /[@#\$%\^&\*]+/g
			if(reg.test(e.target.value)){
				window.vm.$vux.toast.text('含有非法字符，请重新输入', 'center')
			}
			// e.target.value = forbiddenBar(e.target.value);
		},
		checkPhone() {
			this.$verification(this.phone,1,"联系电话")
		},
		fillBack(e) {
			this.enterpriseName = e.name;
			this.enterpriseCode = e.value;
			this.matchpriseList = [];
		},
		search(e) {
			this.enterpriseName = e.target.value;
			if(e.target.value) {
				this.matchpriseList = this.enterpriseList.filter((val) => {
					if(!val.name) {
						return null;
					}
				 return val.name.indexOf(e.target.value) != -1;
				})
			} else {
				this.matchpriseList = [];
			}
		}
    }
}
</script>
<style lang="less" scoped>

.main{
	// overflow: hidden;
	height: 100%;
		background-size: 100% 100%;
    .form-container{
		height: 100%;
        background: #f8fafb;
        border-left: 1px solid #e5e5e5;
        border: 1px solid #e5e5e5;
        background-size: 100% 100%;
        width: calc(100% -16px);
        // margin: 0 3%;
        margin-left:8px;
        margin-right:8px;
        margin-bottom: 10px;
        padding-bottom: 25px;
        border-radius: 8px;
        .name {
          	padding-top: 15px;
        }
        .form-main{
			width: 100%;
			height: 100%;
			// overflow:scroll;
			// margin-top: 130px;
			border-radius: 5px;
			margin-bottom: 30px;
			padding: 0 20px;
			padding-top: 30px;
			color: #333333;
			position: relative;
			.query-time{
				position: relative;
			}
			.one_title{
				height: 30px;
				line-height: 21px;
				display: block;
				position: absolute;
				font-size: 17px;
				font-weight: 700;
				top: 0;
				left: 10px;
				border-bottom-left-radius: 12px;
				border-bottom-right-radius: 12px;
				padding: 4px 0;
				background: rgba(119,136,153,.2);
			}
			 .littleTile{
				font-size: 15px;
				font-weight: bold;
			}
            .warn-content{
                margin-top: 10px;
                margin-bottom: 18px;
                line-height: 30px;
                font-size: 15px;
            }
            h2{
                text-align: center;
                color: #fff;
                width: calc(100% + 40px);
                margin-left: -20px;
                border-bottom: 1px solid rgba(255, 255, 255, 0.24);
                height: 60px;
                line-height: 60px;
                font-size: 24px;
            }
            h4{
                margin-top: 15px;
            }
            .form-border{
                background-color: rgba(255, 255, 255, 0.9);
                color: #333333;
                padding:5px;
                margin: 9px 0;
                width: 100%;
                margin-bottom: 20px;
                border-radius: 3px;
            }
            .tizheng{
                div{
                    width: 33.3333%;
                    float: left;
                    padding: 10px 5px;
                    font-size: 15px;
                    input{
                        vertical-align: middle;
                        width: 15px;
                        height: 15px;
                    }
                }
            }
            .form-twoBor{
                padding: 5px 0;
                div{
                    width: 100%;
                    padding: 5px 10px;
                    input{
                        vertical-align: middle;
                        width: 20px;
                        height: 20px;
                    }
                    label{
                        font-size: 15px;
                    }
                }

            }

        }
        .form-submit{
            width: 90%;
            margin-left: 5%;
            height: 50px;
            background: #228ed9;
            border-radius: 8px;
            color: white;
            font-size: 15px;
            border: none;
            outline: none;
        }
        .form-submiTime{
			width: 90%;
			margin-left: 5%;
			height: 50px;
			background: #228ed940;
			border-radius: 8px;
			color: white;
			font-size: 15px;
			border: none;
			outline: none;
        }
    }
	label{
	//  margin-bottom: 15px;
	}

	input{
		border: 1px solid #cccccc;
	}
	.el-input__inner{
		color: #fdfdfd;
	}
	.el-radio{
		margin: 5px;
		left: -5px;
		width: 100%;
		.el-radio__label{
			color: #000;
		}
		.el-radio__input.is-checked+.el-radio__label{
			color: #000 !important;
		}
		// .el-radio__input .is-checked+.el-radio__label {
		//   color: #000 !important;
		// }
	}
	.el-checkbox{
		width: 100%;
	}
	.yy-city-distance{
		display: flex;
		justify-content: space-between;
		align-items: center;
		.yy-c{
			flex: 1;
			margin-right: 10px;
		}
	}
	#residence{
		// font-size: 12px;
		height: 40px;
	}
	p {
		font-size: 15px;
		padding-left: 5px;
	}
	.textAreaBox {
		position: relative;
		height: 8em;
		padding: 0;
		z-index: 2;
		textarea {
			position: relative;
			width: 100%;
			height: 100%;
			padding: 10px;
		}
		span {
			position: absolute;
			right: 0;
			bottom: 0;
			z-index: 1;
			color: #ccc;
		}
	}
	ul {
		max-height: 100px;
		overflow: auto;
		li {
			margin-bottom: 5px;
		}
	}
}
</style>
